clear

use C:\NR\NR2.DTA

log using c:\nr\nr2.log, replace

*** Preliminary regression to check for outliers

fit gea7090 lgdpea70 sxp sopen
drop dfits
fpredict dfits, dfits
gsort -dfits
* list country dfits shcode6 if dfits~=.
drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list country dfits if dfits~=. & excl1==1

*** Basic regressions without excluding the outliers

fit gea7090 lgdpea70 sxp
fit gea7090 lgdpea70 sxp sopen
fit gea7090 lgdpea70 sxp sopen linv7089
fit gea7090 lgdpea70 sxp sopen linv7089 rl
fit gea7090 lgdpea70 sxp sopen linv7089 rl dtt7090

*** Table I

fit gea7090 lgdpea70 sxp if excl1==0
fit gea7090 lgdpea70 sxp sopen if excl1==0
fit gea7090 lgdpea70 sxp sopen linv7089 if excl1==0
fit gea7090 lgdpea70 sxp sopen linv7089 rl if excl1==0
fit gea7090 lgdpea70 sxp sopen linv7089 rl dtt7090 if excl1==0

*** regression for footnote 18, confirming that controling for
*** growth in the 1960's doesn't vitiate the estimated sxp effect.

fit gea7090 lgdpea70 sxp sopen linv7089 rl dtt7090 gr6070 if excl1==0

*** Table III

fit gea7090 lgdpea70 sxp   sopen linv7089 rl dtt7090
fit gea7090 lgdpea70 snr   sopen linv7089 rl dtt7090
fit gea7090 lgdpea70 pxi70 sopen linv7089 rl dtt7090
fit gea7090 lgdpea70 land  sopen linv7089 rl dtt7090

*** Table IV -- Barro

fit gea7090 lgdpea70 sec70 pri70 gvxdxe revcoup assassp ppi70dev inv7089
fit gea7090 sxp sopen dtt7090 lgdpea70 sec70 pri70 gvxdxe revcoup assassp ppi70dev inv7089

*** Table V -- King Levine

fit gea7090 lgdpea70 kllsec klLLY70
fit gea7090 sxp sopen dtt7090 lgdpea70 kllsec klLLY70

*** Table VI -- Mankiw Romer Weil

fit gea7090 lgdpea70 gp7090 inv7089
fit gea7090 sxp sopen dtt7090 lgdpea70 gp7090 inv7089

*** Table VII -- DeLong and Summers

fit gea7090 lgdpea70 lfg equip nes
fit gea7090 sxp sopen dtt7090 lgdpea70 lfg equip nes

*** Table VIII

fit dmx7090 sxp sopen smx70
fit gnr7090 sxp sopen lgdpnr7 linv7089 rl
fit servs70 sxp

*** Table IX

fit gea7080 lgdpea70 sxp sopen7 dtt7080 linv7079
fit gea8090 lgdpea80 sxp80 sopen8 dtt8090 linv8089 rl

*** Table X

fit ns7089 lgdpea70 sxp
fit linv7089 sxp sopen rl lpip70
fit dtyr7090 lgdpea70 sxp
fit sopen sxp sxp2 land
fit lpip70 lgdpea70 sxp sopen

*** Table XI

fit grc  lgdpea80 sxp
fit re   lgdpea80 sxp
fit corr lgdpea80 sxp
fit rl   lgdpea80 sxp
fit bq   lgdpea80 sxp

log close
